package com.ghy.ic.mo.domain.vo;

import com.google.common.collect.Maps;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.Map;

/**
* @author ytree
* @version v1
* @create 2018年3月6日 
* 类说明 ：输出结果类
*/
@Getter
@Setter
public class OutResult implements Serializable {

	private static final long serialVersionUID = 6535961615059806655L;
	
	private int errcode;
	private String errmsg;
	private Object data;
	
	public OutResult(){
		
	}
	
	public OutResult(int errcode, String errmsg, Object data) {
		super();
		this.errcode = errcode;
		this.errmsg = errmsg;
		this.data = data;
	}
	
	
	
	public OutResult(int errcode, String errmsg) {
		super();
		this.errcode = errcode;
		this.errmsg = errmsg;
	}

	public Map<String, Object> resultMap(int errcode, String errmsg, Object data){
		
		this.errcode = errcode;
		this.errmsg = errmsg;
		this.data = data;
		
		Map<String, Object> map = Maps.newHashMap();
		map.put("errcode", this.errcode);
		map.put("errmsg", this.errmsg);
		map.put("data", this.data);
		
		return map;
	}

}
